/*****************************************************************
 *@Copyright all rights reserved © 2014 Yuga
 *@author Oplink OMS
 *Contact: zengkang007@gmail.com
 *****************************************************************/
package com.oplink.webems.modules.core.entity;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.oplink.webems.common.persistence.DataEntity;
import com.oplink.webems.modules.sys.entity.User;
/**
 * 告警Entity
 * @author Oplink OMS
 * @version 2014-08-11
 */
@Entity
@Table(name = "demo_index")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Index extends DataEntity {
	
	private static final long serialVersionUID = 1L;
	private User user;
	private int sort; // 排序
	private String url; // 语音库地址
	private String name; // 文件名称
	private String format; // 文件格式
	private String size; // 大小

    
	  public String getUrl() {
        return url;
      }
      
      public void setUrl(String url) {
        this.url = url;
      }
    
	  public String getName() {
        return name;
      }
      
      public void setName(String name) {
        this.name = name;
      }
    
	  public String getFormat() {
        return format;
      }
      
      public void setFormat(String format) {
        this.format = format;
      }
    
	  public String getSize() {
        return size;
      }
      
      public void setSize(String size) {
        this.size = size;
      }
    
    
    // JPA 基于USER_ID列的多对一关系定义
	@ManyToOne
	@JoinColumn(name = "user_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	} 
	
	@NotNull
	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}
}
